﻿using ApiDAL.Common;
using ApiModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ApiModel;
using System.Data.SqlClient;
using System.Data;
using DataAccess.SqlClient;
using System.Text;

namespace ApiDAL
{
    public class Admindal
    {
        public int AdminLogin(string adminname, string password)//管理员登录
        {
            SqlQuery SQL = new SqlQuery();
            SQL.CommandText = "AdministratorLogin";
            SQL.CommandType = CommandType.StoredProcedure;
            SqlParameter sp1 = new SqlParameter();
            sp1.Value = adminname;
            sp1.ParameterName = "@adminname";
            SQL.Parameters.Add(sp1);
            SqlParameter sp2 = new SqlParameter();
            sp2.Value = password;
            sp2.ParameterName = "@password";
            SQL.Parameters.Add(sp2);
            int i =Convert.ToInt32(SqlDataAccess.ExecScalar(SQL));
            return i;
        }
    }
}
